package designMode.compoundPattern;

/**
 * @author LIBOFEI
 * @ClassName CountingDuckFactory
 * @description 创建一个工厂，此工厂创建装饰过后的鸭子
 * @date 2020/7/1 14:56
 * @Version 1.0
 **/
public class CountingDuckFactory extends AbstractDuckFactory {
    @Override
    public Quackable createGreenDuck() {
        return new QuackCounter(new GreenDuck());
    }

    @Override
    public Quackable createRedDuck() {
        return new QuackCounter(new RedDuck());
    }

    @Override
    public Quackable createDuckCall() {
        return new QuackCounter(new DuckCall());
    }

    @Override
    public Quackable createRubberDuck() {
        return new QuackCounter(new RubberDuck());
    }
}
